
#ifndef ERASEOPERATION_H
#define ERASEOPERATION_H

#include <BColor>
#include <BCircle>
#include <BHBoxLayout>
#include <BLabel>
#include <BSlider>
#include <BSpinBox>

#include "Operation.h"

class EraseOperation : public Operation
{
public:
	EraseOperation();
	~EraseOperation();

protected:
	void slotRadiusSliding(BObject* object, const BValue& value);
	void slotRadiusEditFinished(BObject* object, const BValue& value);
	void slotRadiusChanged(BObject* object, const BValue& value);
	void slotColorButtonClicked();

protected:
	virtual void attached(BWidget* widget);
	virtual void detached(BWidget* widget);

	virtual void paint(BPainter& painter);
	virtual void update(double time);

	virtual void freshEvent(const BEvent& event);
	virtual bool focusEvent(const BEvent& event);
	virtual bool keyDownEvent(const BKeyEvent& keyEvent);
	virtual bool keyUpEvent(const BKeyEvent& keyEvent);

	virtual bool mouseEnterEvent(const BMouseEvent& mouseEvent);
	virtual bool mouseLeaveEvent(const BMouseEvent& mouseEvent);
	virtual bool mousePressEvent(const BMouseEvent& mouseEvent);
	virtual bool mouseReleaseEvent(const BMouseEvent& mouseEvent);
	virtual bool mouseMoveEvent(const BMouseEvent& mouseEvent);

private:
	BHolder<BHBoxLayout>	_layout;
	BLabel*					_eraseLabel;
	BSlider*				_sizeSlider;
	BSpinBox*				_sizeSpinBox;
	BButton*				_colorButton;

	bool				_pressed;
	BPoint				_eraseCenter;
};

#endif
